<?php

// @author 3ogx <3ogx.com@gmail.com>

namespace Jushuitan;

use Illuminate\Support\ServiceProvider;
use Jushuitan\Console\RefreshTokenCommand;

class JstErpServiceProvider extends ServiceProvider
{
    public function register(): void
    {
        $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'jst');
    }

    public function boot(): void
    {
        if ($this->app->runningInConsole()) {
            $this->commands([
                RefreshTokenCommand::class,
            ]);

            $this->publishes([
                __DIR__ . '/../config/config.php' => $this->app['path.config'] . DIRECTORY_SEPARATOR . 'jst.php',
            ]);
        }
    }
}
